home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 September / PCWorld_2008-09_cd.bin / v cisle / sadanastroju / delicious_bookmarks-2.0.64-fx.xpi / chrome / deliciousBookmarks.jar / content / menuitemHeader.xml < prev    next >
Encoding:
Extensible Markup Language  |  2008-06-19  |  2.9 KB  |  81 lines

  1. <?xml version="1.0"?>
  2.  
  3. <bindings xmlns="http://www.mozilla.org/xbl"
  4.           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  5.           xmlns:xbl="http://www.mozilla.org/xbl">
  6.  
  7.   <binding id="menuitemHeader">
  8.  
  9.     <resources>
  10.       <stylesheet src="chrome://ybookmarks/skin/menuitemHeader.css" />
  11.     </resources>
  12.   
  13.     <content>
  14.      <xul:hbox align="center" flex="1"> 
  15.        <xul:label anonid="mainLabel" flex="1" crop="right"
  16.             xbl:inherits="value=label,tooltiptext=tooltip,onclick=oncommand,crop"/>
  17.        <xul:vbox anonid="separator" class="separator" hidden="true"/>
  18.        <xul:label anonid="extraLabel" hidden="true"
  19.            xbl:inherits="value=extlabel,tooltiptext=exttooltip,onclick=extoncommand" />
  20.        <xul:box anonid="menuContainer" hidden="true">
  21.        <children includes="menu" />
  22.        </xul:box>
  23.      </xul:hbox>
  24.  
  25.     </content>
  26.     <implementation>
  27.       <constructor>
  28.         <![CDATA[
  29.           var mainLabelElement =
  30.              document.getAnonymousElementByAttribute(this, "anonid", "mainLabel");
  31.  
  32.           var separatorElement = 
  33.              document.getAnonymousElementByAttribute(this, "anonid", "separator");
  34.           
  35.           var extraLabelElement = 
  36.              document.getAnonymousElementByAttribute(this, "anonid", "extraLabel");
  37.           var menuContainer = 
  38.              document.getAnonymousElementByAttribute(this, "anonid", "menuContainer");
  39.           //show appropriate elements
  40.           var showextraAttribute = this.getAttribute("showextra");
  41.           if (showextraAttribute) {
  42.             var extraArray = showextraAttribute.split(",");
  43.             for (var i=0; i<extraArray.length; i++) {
  44.               
  45.               if (extraArray[i] == "separator") {
  46.                 separatorElement.hidden = false;
  47.               }
  48.               else if (extraArray[i] == "link") {
  49.                 extraLabelElement.hidden = false;
  50.               }
  51.               else if (extraArray[i] == "menu") {
  52.                 menuContainer.hidden = false;
  53.               }
  54.             }
  55.           }
  56.           
  57.           //if the oncommand contains something, the main label would be displayed as link
  58.           //else it would be displayed as dislabed text        
  59.           var oncommandAttibute = this.getAttribute("oncommand");
  60.           if (!oncommandAttibute) {
  61.             mainLabelElement.disabled = "true"; 
  62.           }
  63.           else {
  64.             mainLabelElement.className = "label-link";
  65.           }
  66.  
  67.           //if the extoncommand contains something, the extra label would be displayed as link
  68.           //else it would be displayed as normal text
  69.           oncommandAttibute = this.getAttribute("extoncommand");
  70.           if (oncommandAttibute) {
  71.             extraLabelElement.className = "label-link";
  72.           }
  73.           
  74.         ]]>  
  75.       </constructor>
  76.     </implementation>
  77.     
  78.   </binding>
  79.   
  80. </bindings>  
  81.